using System;
using System.Collections.Generic;
using System.Text;
using Mpi.Common.Collections;
using System.ComponentModel;

namespace Xeml.Document.EnvironmentalOntology
{
    public class ConvertableUnit : Unit
    {
        private string conversionString;
        private Unit defaultUnit;

        public string ConversionString
        {
            get
            {
                return this.conversionString;
            }
            set
            {
                this.conversionString = value;
            }
        }

        public Unit DefaultUnit
        {
            get
            {
                return this.defaultUnit;
            }
            set
            {
                this.defaultUnit = value;
            }
        }
    }

    public class UnitSet 
    {
        private string name;
        private Unit defUnit;
        private List<ConvertableUnit> convUnits;

        public List<ConvertableUnit> ConvertableUnits
        {
            get { return convUnits; }
        
        }


        public Unit DefaultUnit
        {
            get { return defUnit; }
            set { defUnit = value; }
        }


        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        public UnitSet()
        {
            this.convUnits = new List<ConvertableUnit>();
        }

        #region IIdObject<string> Members


        //private Dictionary<string, UnitSet> _collection;
        //public Dictionary<string, UnitSet> Collection
        //{
        //    get
        //    {
        //        return this._collection;
        //    }
        //    set
        //    {
        //        if (value == null)
        //        {
        //            if (_collection != null)
        //            {
        //                this._collection.Remove(this.);
        //                this._collection = null;
        //            }
        //            return;
        //        }

        //        if (!value.Contains(this.ObjectIdentifiere))
        //            throw new ArgumentException("This object is not a member of the target collection");
        //        this._collection = value;

        //    }
        //}

        //[Browsable(false)]
        //public object CollectionObject
        //{
        //    get
        //    {
        //        return this._collection;
        //    }
        //    set
        //    {
        //        this.Collection = (IdentifiableObjectCollection<string, UnitSet>)value;
        //    }
        //}

        //public string ObjectIdentifiere
        //{
        //    get { return name; }
        //}

        #endregion
    }
}
